if (false) {
    window.miniPlatform = (function () {
        function miniPlatform() { };
        miniPlatform.systemInfo = null;

        miniPlatform.init = function () {
            console.log("头条平台初始化...");
            if (!window.tt) {
                return;
            }
            window.tt.showShareMenu({
                withShareTicket: true
            });
            miniPlatform.systemInfo = tt.getSystemInfoSync();
        }

        miniPlatform.initAds = function ({ bannerid, videoid, interid }) {
            ii.log.log(`bannerid  ${bannerid}  videoid ${videoid}  interid ${interid}`);
            miniPlatform.initBanner({ id: bannerid });
            miniPlatform.initVideo({ id: videoid });
            miniPlatform.initInterstitialAd({ id: interid });
        }

        miniPlatform.login = function _async() {
            return new Promise((resolve, reject) => {

            });
        }

        miniPlatform.onVideoErrorHandler = function (error) {

        }

        miniPlatform.onVideoCloseHandler = function (result) {

        }

        miniPlatform.initVideo = function (params) {

        }

        miniPlatform.playVideo = function _async() {
            return new Promise((resolve, reject) => {
                resolve(true);
            })
        }



        miniPlatform.initBanner = function (params) {

        }

        miniPlatform.showBanner = function () {
            miniPlatform.bannerType = "normal";
            if (miniPlatform.bannerId == null) { return; }
            if (miniPlatform.bannerAd == null) {
                miniPlatform.initBanner();
            }
            if (miniPlatform.bannerAd) {
                if (miniPlatform.bannerStyle) {
                    console.log("wxd show()准备修改banner style:", (miniPlatform.systemInfo.windowWidth - miniPlatform.bannerStyle.width) / 2, miniPlatform.systemInfo.windowHeight - miniPlatform.bannerStyle.height)
                    miniPlatform.bannerAd.style.top = miniPlatform.systemInfo.windowHeight - miniPlatform.bannerStyle.height;
                    miniPlatform.bannerAd.style.left = (miniPlatform.systemInfo.windowWidth - miniPlatform.bannerStyle.width) / 2;
                }
                miniPlatform.bannerAd.show();
            }
        }



        miniPlatform.hideBanner = function () {
            miniPlatform.bannerAd && miniPlatform.bannerAd.hide();
        }

        miniPlatform.initInterstitialAd = function (params) {
            if (!window.tt || typeof window.tt.createInterstitialAd != 'function') {
                return;
            }
            miniPlatform.insertId = params.id;
        }

        miniPlatform.showInterstitialAd = function _async() {
            return new Promise((resolve, reject) => {
                if (!window['tt']) {
                    console.log("显示插屏 showInterstitialAd");
                    return;
                }
                if (miniPlatform.insertId == null || miniPlatform.insertId.length <= 0) {
                    console.warn('方法（ initInsert ）缺少必要参数（ id ）', 'miniPlatform');
                    reject();
                    return;
                }
                miniPlatform.insertAd = tt.createInterstitialAd({ adUnitId: miniPlatform.insertId });
                if (miniPlatform.insertAd) {
                    miniPlatform.insertAd.onError((error) => {
                        reject(error);
                        miniPlatform.insertAd && miniPlatform.insertAd.destroy();
                    });
                    miniPlatform.insertAd.onClose(() => {
                        resolve();
                        miniPlatform.insertAd && miniPlatform.insertAd.destroy();
                    });
                    miniPlatform.insertAd.load().then(() => {
                        miniPlatform.insertAd.show();
                    });
                } else {
                    reject(error);
                }
            });
        }

        miniPlatform.curTime = 0;

        miniPlatform.statusBarHeight = function () {
            return miniPlatform.systemInfo ? miniPlatform.systemInfo.statusBarHeight : 0;
        }

        miniPlatform.screenWidth = function () {
            return miniPlatform.systemInfo ? miniPlatform.systemInfo.screenWidth : 1;
        }

        miniPlatform.screenHeight = function () {
            return miniPlatform.systemInfo ? miniPlatform.systemInfo.screenHeight : 1;
        }

        miniPlatform.vibrate = function (params) {

        }
        miniPlatform.isNetValid = function () {
            return true;
        }
        miniPlatform.addEventShow = function (func) {

        }
        miniPlatform.addEventHide = function (func) {

        }
        miniPlatform.showToast = function (msg) {
            if (!window['tt']) {
                console.error(msg);
                return;
            }
            tt.showToast({
                title: msg,
                duration: 2000,
                icon: "none"
            });
        }
        miniPlatform.reportAnalytics = function (eventName, data = {}) {
            if (!window['tt']) {
                console.log(`打点事件 eventName : ${eventName} + data : ${JSON.stringify(data)}`);
                return;
            }
            tt.reportAnalytics(eventName, data)
        }



        return miniPlatform;
    })()
}